package edu.ccut.titan.tag.report.tag;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;

import edu.ccut.titan.tag.report.design.NoDataCellInfo;

public class TitanNoDataCellTag extends TagSupport {
	private static final long serialVersionUID = -5759031981280484559L;
	private String value = "0";
	private String clazz = "java.lang.Object";
	private TitanCrosstabTag crosstabTag;
	private NoDataCellInfo noDataCellInfo;
	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public String getClazz() {
		return clazz;
	}

	public void setClazz(String clazz) {
		this.clazz = clazz;
	}

	@Override
	public int doStartTag() throws JspException {
		crosstabTag = (TitanCrosstabTag) this.getParent();
		noDataCellInfo = new NoDataCellInfo();
		noDataCellInfo.setClazz(clazz);
		noDataCellInfo.setValue(value);
		crosstabTag.addNoDataCellInfo(noDataCellInfo);
		return EVAL_BODY_INCLUDE;
	}

	@Override
	public int doEndTag() throws JspException {
		return SKIP_BODY;
	}

}
